import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams,ModalController ,LoadingController,ToastController,ViewController} from 'ionic-angular';
import {Storage} from '@ionic/storage'
import { BaseUI } from '../../commom/baseui';
import {RestProvider} from '../../providers/rest/rest';
import {ImgpickerPage} from '../imgpicker/imgpicker'
import {InAppBrowser} from '@ionic-native/in-app-browser'
import {VideoPage} from '../video/video'
import { AudioPage } from '../audio/audio';

/**
 * Generated class for the NotificationPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-notification',
  templateUrl: 'notification.html',
})
export class NotificationPage extends BaseUI {

  errorMessage: any;
  notificationList:string[];
  constructor(public navCtrl: NavController,
    private iab: InAppBrowser,
    public navParams: NavParams,
    public modalCtrl: ModalController,
    public storage:Storage,
    public loadingCtrl: LoadingController,
    public rest: RestProvider,
    public toastCtrl: ToastController,
    public viewCtrl:ViewController) {
    super()
}

  ionViewDidLoad() {

   
    // this.storage.get('UserId').then((val)=>{
    //   if(val!=null){
    //     //加载用户数据
    //     var loading = super.showLoading(this.loadingCtrl,"加载中...");
    //     this.rest.getUserNotifications(val)
    //     .subscribe(
    //       n => {
    //         this.notificationList = n;
    //         loading.dismiss();
    //       },
    //       error => this.errorMessage = <any>error);
    //   }
    // });
  }

  gotoWebview(){
    const browser = this.iab.create('https://dj.nmdsy.com/Mobile_login.html','_blank','location=no,toolbar=yes,toolbarposition=top,closebuttoncaption=关闭');
    browser.show()
   }
  
  gotoImgPIcker(){
    this.navCtrl.push(ImgpickerPage)
  }

  gotoVideo(){
    this.navCtrl.push(VideoPage)
  }
  gotoAudio(){
    this.navCtrl.push(AudioPage)
  }


}
